home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / VPOJAVA.DLL / SOURCE / WINDOW < prev   
Text File  |  1998-12-10  |  1KB  |  51 lines

  1. /*
  2.     A basic extension of the java.awt.Window class
  3.  */
  4.  
  5. import java.awt.*;
  6.  
  7. public class Window1 extends Window
  8. {
  9.     public Window1(Frame parent)
  10.     {
  11.         super(parent);
  12.         // This code is automatically generated by Visual Cafe when you add
  13.         // components to the visual environment. It instantiates and initializes
  14.         // the components. To modify the code, only use code syntax that matches
  15.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  16.         // parse your Java file into its visual environment.
  17.         //{{INIT_CONTROLS
  18.         setLayout(null);
  19.         setSize(430,270);
  20.         //}}
  21.     }
  22.  
  23.     public void addNotify()
  24.     {
  25.         // Record the size of the window prior to calling parents addNotify.
  26.         Dimension d = getSize();
  27.         
  28.         super.addNotify();
  29.  
  30.         if (fComponentsAdjusted)
  31.             return;
  32.  
  33.         // Adjust components according to the insets
  34.         setSize(insets().left + insets().right + d.width, insets().top + insets().bottom + d.height);
  35.         Component components[] = getComponents();
  36.         for (int i = 0; i < components.length; i++)
  37.         {
  38.             Point p = components[i].getLocation();
  39.             p.translate(insets().left, insets().top);
  40.             components[i].setLocation(p);
  41.         }
  42.         fComponentsAdjusted = true;
  43.     }
  44.  
  45.     // Used for addNotify check.
  46.     boolean fComponentsAdjusted = false;
  47.  
  48.     //{{DECLARE_CONTROLS
  49.     //}}
  50. }
  51.